﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Winowajca
{
    public partial class WineInfoView : System.Web.UI.UserControl
    {
        public Wine Wine { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Wine == null)
            {
                return;
            }

            lblName.Text = Wine.Name;
            lblSugar.Text = Wine.WineSugar.Name;
            lblColor.Text = Wine.WineColor.Name;

            if (!string.IsNullOrEmpty(Wine.Origin))
            {
                lblOrgin.Text = Wine.Origin;
            }

            if (Wine.Price.HasValue)
            {
                lblWineCost.Text = Wine.Price.Value.ToString();
            }

            if (!string.IsNullOrEmpty(Wine.WhereBought))
            {
                lblwhereBought.Text = Wine.WhereBought;
            }

            lblRaiting.Text = Wine.Rating.ToString();
        }
    }
}